fixed a mysql script in MessageManager