added null check to avoid reinitialization