Bug fix for registering new users