Fixed sql not being closed on disable