Database logic changed