added more synchronization to avoid filesys crash