fixed bug in submit form javascript