Bug fix canvas animation