add localdatabse for performance (not finished)