implemented abort analysis function and error handling