fix #23 and #22