updating download method to use proxy if available