fix test function