rename delay to when