fix to use name variable