better error handling in chunk creation