update code for 3.7