using object passed in rather than pid
Merge pull request #1 from willtp87/7.x

using object passed in rather than pid