change while( true ) to while( 1 )