Adding graceful fallback for missing user ID