buggy damn simple socket programming in python