Fixed a endless loop