fixed notice with undefined variables