add additional check in getData()