canvas animation now pauses when there are errors