bugfix: unlock file after it closed