fixing dict iteration error in user migration script