fix setTag to avoid memory leak