change malloc to new