Fix issue with user realm refactoring