fix dir permissions during upgrade