Check previous request and set connection timeout to curl