bug fixed: forgot to multiply by sizeof in memset