handle creation of root pages correctly in oncreatePage callback
handle page type changes correctly