moved the delay to a variable