fixing undefined field