Cannot change user email in custom database

Hi. When trying to change user mail it gives the following error “Cannot read property ‘node’ of undefined”, using custom database, added get user script and it works. What do i need to do so that i can change user’s mail?