clean shutdown and init pos