Fixed variable assign in wrong place.