Removed a line from the query that attempts to take a lock on the relationship as it did not work