Added error message for socket errors