Added checking if response is not None

If response was None it caused Connection timed out.