Fixed a multiple error message issue on create election

It showed two error messages for the same error message cause of
loading all the js scripts.