moved Python version check to the beginning of the script