fixing #151 and #152