moved delay to a var