Added a helper func get_error_element()