fix check type of message