fix error that sometimes occurs when users are deleted