Bug that connection not being closed properly fixed.