FIX: handle undefined $parent