Add logging for file locking
Added additional to avoid 'uninitialized value errors'