fixed some stuff that causes unworking migration script
changes default permission on cache