added some more logic
now handles unknown objects