fixed boolean cast for pg