Fixed error when data is null