rewrite test rule so that it will unregister afterwards