Added null check for first time startup