checking for mat is empty