fix end handler to not have arguments