adds delay logic to python