fixed #121 and fixed #91