fixing test function in wrong place