fixes js canvas errors