fixing 'update' functionality