inifitely loop fixed