edit detect to run automatically