fixed check_user helper method