cleanup on measurement