add errors and debugging example