fixed function instead of var syntax error