Fixed task query bug