replaced pass name by value with pass name by referance