undefined check corrections