replacing three.js deprecated method