use setTimeout() instead of delay()