prevent errors when a null element is returned