fix purchase avg nan