As lostzac said: You need to define that function before!
The script can't perform a function it doesn't know.