introduce a helper for page wait