bug fix (yet still work in progress)