account for samread returning -1