add some checking