error handling and implementing spec scan