fixing error with minssing costs