1. Fixed some bad part of the form
2. Reduced the code in the event