fix pages callback bug