fix Handler instance reference inside closure