Prevented nullpointer exceptions in Data class