updated patch (using a separate hook) and futher thoughts