migrate script fixes