fixed #8 fixed #11 fixed #12 fixed #13