fix <= query bug