On-the-fly string method for minimum free energy paths calculation