added polyfill and collisions with canvas