Fixed bug around deleted queries still running