Added error handling in getUsers()