fixing permissions and ownership