add check code, not finish yet