fix for #174, #78