Bugfix: for update function