better lock-engine auto-detection