fixed database migration problems