add utils and fix some bug