Fix a out range bug