Fix exception and improve error message
Improve user checking