update device test and fix bugs after test