add debug; fix registration