before handling