fixed error when calling "calloc"