fixed task update function