fixed #12, fixed #12 and fixed #14