avoid printing obj if it might be undefined