fixed #5, #10, #12