fixing #51 and #68

fixing #51 and #68