Most of the time when I get a type mismatch error it is because I either misspelled something, or I didnt list a field everywhere I should have.
Most likely that is your problem, you said you changed the name of the function, so perhaps it is looking for something wiuth the original name. Just guessing.