hm, to_x can raise NoMethodError by itself. may be here better check respond_to? instead of try except.