fixed redundant code