Modified version checking syntax to be compatible with python2.6