ensure finish is a function