Changed relations to database