fix decode length issue