implemented #132, possible fix for #125 as well.