fixed logical error in AOI