fix unused vars
Fix socket message reading