Fix for bug when changing user