debug staging error - scope is undefined