fix major bugs