add "apply" handler