UserID not defined

userid is not yet defined here. Causes error.