fixed script to use non-deprecated method. it looks like it works better.