Updates database logic