replaced .cost() with .cost