Fixed bug of not-returning anything from the getDelay function