CW-32
adding "try/catch" and adding "unregister" if exception caught.