Adding another null check to prevent another crash