fix some bug in flatsServer.py