message printing works correctly with both python2 and python3