`if(currentFrame)` => `if (currentFrame)`

Also it would ideal if there were curly braces, including the preceding calls ^^^