modified server.c: add check command