update code for 3.7 API