transplant https://github.com/Supervisor/supervisor/pull/162/