fixed bool use of sum(select)