fix variable scoping issues preventing customer view page from coing up