new version: some bugs are fixed