fixed bug that could not append to a file in a folder