fix on shutdown