fixed disabled bug, fixed memory leak