added version checking, doesn't work in older versions