Added Agent Support - credit to https://github.com/lgtml