added done event when state is finished