FIXED: term_to_atom does not silently fail on syntax error, so we need to catch the exception