replaced eval with a more safe getattr