fix redundant code