fixing error condition