optimized auto-update mechanism, fixed #8