Improved the get_user function