Eof exception fix

Fix for URL connections in SDK 13+