Added better undefined checking to getItemDetailsForUser