Compatible for both versions of python