fix bug with handler state update on finish