Small fix in logic