added validation for getting user id