improved exceptions
input fix for python2