fix message/action not worked when script exits using stop()