bugfix array mem allocation