fixes ownership bug of files written with sudo