use local keyword in function