fix chi squared