added user add function and updated update function