fixed some error handling in load data