fix sleep() by making loop variables volatile