ran but the while loop has no exit