fix problem with empty lists