add user login and fix tests