fix a bug in perpetual test