fixing check for msg_type