fixed #4 fixed #5 fixed #9 fixed #10 fixed #11