Null check to avoid potential crash