Added an error from a code sample from Alan M Dunsmuir - thanks