Fix name of function
Check correct variable