potential fix for value undefined problem