error handling for .set