Solving sumbit refresh problem