finish the putuser function