update and fix some bug