Fix undefined value to first variable