Add error handling for syncfs