Fix a logical error here