Javascript Tetris Error

Hey everyone, I’m working through a tutorial.

I’ve created a function that causes the tetrominoes to fall down and then freeze in place.

However, it is not freezing properly. It seems to stop and then morph into a new tetromino at the bottom of the game (which then flows out of the game entirely).

Here is a link to the codepen: