updated code to reset users correctly