Changed the method by which we lock the table