small fix to detect script logic