Added a check for UserId