Added error handling to the data import