Accessing incorrect foreign_key name