Changed to use getType() in place of getFunction()