users: define validation function as helper