added v2/v3 support