check before decode