fixed odd memory error in example code