fixed testing code