Change val to def to resolve odd initialization behavior