Moved getInputStream() into thread