fixed occasional errors