replaced expensive conditional with simple truthy statement to end animation frame and call user callback