fixes issue where HandlerFunc panics before draining input channel