Fixed potential issue if data is null