replace deprecated method
Merge pull request #998 from tshepang/patch-3

replace deprecated method