fix undefined diff case without breaking void element case