Added check for python version 2