removed unnecessary dynamic allocation