Fix user registration bug