added fix for ECONNRESET per http://stackoverflow.com/a/16676271/516433