fixing bugs for tests