adds better error messages for login/edit