Removed while(true) loop