fix bug in chunk validation