Add onfinished callback