Fixed bugs in local storage of user details