Adds afterInit callback