bug fix (thanks AJD!)