fix bug in testing