Fixed error when registering user