Add code to extract the user_id if it's available