fixing problem with $name var