converted from 2.1.7 to 3