ajax page transition applies css of next page

ajax page transition applies css of next page

I have a single page based 1.4.5 app using ajax to navigate between the pages. I have two similar style sheets which are loaded in the data-role="page" each time.  I have noticed that if alternate between pages (and loading is slow), just before the page loading message disappears it seems to pick up the style sheet from the new page and restyle the current page.  It then transitions to the new page which shows correctly.

I am not 100% sure what is making it restyle, as I can see the new page is being added to the bottom of the dom, so it should not be using the new page style sheet.

I know I can change all the class names to stop this, but is there a way I can stop the restyling of the ui-page-active page.