add prepare func before custom handle