Fix for array oob exception