Added delay to some script functions