Added code for user login
Fixing bugs