Corrected bug on form when switching tab