Add error handling to users class