fix auto-detection