fix bugs about negative cost