fixed leaked var