fixed testing bugs