logical error is fixed