cannot fix the bug about map losing socket