Added check if clob is open before attempting to close it