Fix form refresh bug