added message type and email check