update database functionality