fixing major bugs