fixed issues with variables