Fixed memory leak on mechanism