Improved code for dealing with unread locked columns