fix some bug, add init script