fixing update functionality