Add error handling with maxsize and completion messages