Fix bug with var not definied