cleanup, locks, correct socket receive, and it works...