Added some trace statements to to lock and unlock methods