Resource registering moved from beforeRender() to afterRender()