fix mem corruption
sample update