Finish event function.