fix pep8 warnings
remove useless check causing error