fixed minor bug with costs