add method to attach afterConstruct event