restrict invalid election_ids in election detail