fix bool comparison, thanks @xbgmsharp