fix bug regarding updating epoch during election and sync