Removing duplicate encode