import bugfix from
https://github.com/appium/appium/commit/08e4b8e4071c2a9715aecf602d45e981e8ab5df8