fixing vars and it now works