Fixed variable passing issue