updated detect and compile