Added sleep to the delay parameter
Corrected the smart adaptation