changed while loop condition
not sure if it will stop dc