fixed #26 and closed #7