fix for 3.x and 2.x