minor fix to test function