fix test code to work in 1.8.7 version