corrected undefined variables  and  by removing them