Using filter instead of get
Adding some logging around the duplicate key integrity error