add compatibility from tulingkry pull request