Edited the check_user function