Added exception handling to data engine