not requireing the query type to be a select, also was not checking the value of the boolean
testing when distinct is set to false