add afterInitialize callback