Removed $user_id as a function parameter