If at the trial of any action or motion, there appears to be a variance between the evidence and allegations or recitals, the court, if in its opinion substantial justice will be promoted thereby, may allow the pleadings to be amended to conform to the proof.