Removed dead file reference
Added null check to prevent null reference exception