change self.id to self[:id] to avoid id overriding methods fixing #240