fix for issues #19 #18 #17