Added more checks to try.
Added checks in the update code also.