registration improvement (fixes #2)