fixed an edge condition in data detection