added debugging around socket read