Added rough afterCompile event handling