Another Fixing code after Pycharms Code Inspection