error handling scan