Added afterParse event and rename onInit to init