prepare

fix some bugs in login form, add comments for some part of code