detect and run as needed