refactoring of user check on actions
added validation for registering