fix #22 and #23