improve updating functionality