change class malloc to new