fixed #28 and #10