fixed insertLeave event & updated ruby script