Add security to test function