fixed database foriegn keys