Bool value check doesn't use ```==```, you'd better change them to ```xxx is not False``` or ```not xxx```