Solution principle:
You have understood that when the row you looking for don't exist, you display wrong data.
The solution is quite simple, Check if actual row is the right one before displaying data or alert message.
Pseudo code:
If (row found) Then
display Data
Else
display Alert message
End If