fixing issues with database migration