Could handle the error more gracefully: an alert for example