fixed (hopefully) premature 'socket' closure