Handle canvas error
Move initialize code