modify and fix bugs