add callback for database