add clause for empty message id