[AM] delete function bug fix v2