fix varaible handling