What do you want finally?
Seems to me there is at least one problem with your code: sec_func doesn't use the param1 variable.
There may be others.