Chnage how var are passed
Added some logs