Add setting page and serveral bugs fix