fixed errors with election