improved userId check handling