Added delay functionality