Added error handling to processor