fixed issue of cleanup on save