hotfix negative array indexing