fix bug for mysql