fixed some unnecessary code