Fixing undefined var