fix example bug / logic error