fix clamp bug