implemented fix described at link

https://github.com/atesh/XKit/issues/144