fixed cast exception.