Read back function works. Array written wrong in function parameter