Fix for #61. Missing after and before callbacks in js handler