Updated validation for optional user_id key