remove unnecessary undefined check