Added exception handling to deal with high cpu loads