added reference to delay function