use function instead of var