Implement the finish event with latest nodejs api