[fix] also make sure onFinish is present and a function