removed while(1)