Add guard if no function is defined