fixed bag scanner to send messages, and made message class