Handle old and new page transition