refine logging
refine logging
implement move to function
Add more failover control