Added empty contacts check