fix to access values safely