added better proxy handling. comments.