Identifying messages with the check_for_msgs() function