Fix error handling and Delayed Exec