Fices issue with undefined data