replace calloc with malloc