fixed error handling and added load button