(XDK) Fixes re-entrancy