Fixed issues with new version

Included a version check to fix incompatibility with new version