fixed memory leak on interrupt