Only change document title to null if needed