fix bug for user registration