defensive code against ultra rare bug