Fix error 500 login and register