fix of #81 and #78