fix form, browser compatibility, clean code