fixed -1 return for piece protocol