Cannot close statement that is already closed