Set the $user_id global if it's empty