fix a bug about a star search infinite loop