fix regression of not being able to addLayer in initHooks