fix bug in elseif