fixed some issues in user state.
fixes to users and core