fixed bug mentioned in comment of #135