fixed #19 and #24