fixes #2291 Wrong error message when you try to add a new user

Fixed the issue and committed code for review, please check it.