Fixed login functionality and register functionality