updated page transition code