removed all the logical error