added custom implementation for login and register