Add some database logic