add end method code to initialize method