fix issue #22 #23 #24 #25 #26