added delay and duration support