update function

alternative does not work