Added logic to check for undefined pre tags.