cherry picking https://github.com/twitwi/deck.js/commit/31db782378efc66f627a64c905d2c7936ee74604#diff-d41d8cd98f00b204e9800998ecf8427e