Fixes undefined check