Also, please wrap the whole searching section in
```
if (sms.getId() != null) {
```
If it is `null`, there's no point in wasting time searching.