fixing #181 and #195