improve error handling
add utils function to welectionService