switched entitymanager to use unique_ptr