fixed issue where element list sometimes contained undefined elements and returned null