remove unused variables

remove some unused variable and also fix warning