added support for typed arrays