Added proper error handling of OptionalData