add better checking