fixed ESP free bug