added error handling for non-existent painting