bug fixed: memset usage