replace deprecated method
Merge pull request #999 from tshepang/patch-5

replace deprecated method