Added sleep functionality, attempting to resolve erros handling url requests