properly clear user db map
unify error handling