fixed some bugs, reversion 0.98.11