fixed a bug in the server