adding optional interval parameter to set interval between requests