[AM] delete function bug fix