Add error handling for bad data, update layout