toolbar works with python2
need to make it compatible with python3