implementing test handling