update hasData function