fix bugs, distributed mode is available now
remove old codes