better specs. fix some bug