Fix while statement

time.sleep returns None.