Define function only when it doesn't exist