fix a logical error. Unfortunately is not the source of the error