fix some form popup bugs