updated logic during error