fixed many bugs for login module