Add basic error handling