removed errors and update function