added undefined check for cells