Removed 'duplicate entry' bug whlie saving to db in representation