Adding lock to login and register