done with mongo query for login and register