added check that user is not undefined type for activat e-function