add debug library,fix some bug