fixed incorrect function var