fix finalize callback