Added more functions for local database.