make sure locks index is positive