continuing to work in clock window.
added delay function