Adding delay functionality