Added exception handling to DataRepository