small logical error