Added error handling to userpage