Forked version for 1.7