change handlers
fix bug when register
fix several bugs