connected invoice history to db