fixed empty lists problem