some database logic changes