fix error logging in handleError
fix email length check