Fix undefined data error