Fixes error when duplicating an entry