fixed -Inf problem