add logging when exceeding array bounds