Changed where the new entites variable is set