Remove evil while loop