fix for #93 and bugfix for #131