improve typed arrays error