fixing undefined