fix double close on statement