bug fix and delay added