bug fix for issue found by Greg Skinner