fixed #19 and fixed #22