Add the delay function