Fix logical mistake