Fixed error: TypeError: unorderable types: int() > NoneType()