add login verification and error handling