added login and error