Fixed bug entering an infinite loop