fixed #22 and #23