add monitor and some shell command, fix various small problems and bugs