fix variable passing