fix -1s problem