merged in v3 branch