Fix module undefined check