fix warnings and add msghandler member in server