fixed error with registering same username

Fixes bug #22.