Updated with better error handling around eval