restore ownership and permissions