fix -1 error