added code to handle an error some users are reporting.
updated version.