STOP running queries when closing connection