added while(true) loop