set -1 cost on error