Changed the hard coded id method to a more flexible primary_key method.