Added empty message handling