Fixed bug that didn't store cost correctly