adds event for update action in js