add exception handling for evaluate()