Fixed mem leak in tutorial 3