Fixed issue with files getting locked