works for .onEnd()