further bugfixing for unexpected restart problem and device auto-lock disable feature