fixed deprecated new by reference