added condition to check that tested function exists