add afterCreated callback