added afterInit function