fixed error where it wasn't finding the right records