add print_message function so messages get flushed in eclipse console