added check to ensure value is set