fixed bugs #34 and #35