fix unnecessary codes