Improved surface quality of Nd:YAG monitored by second harmonic generation