[Bug Fix] Index Out of Bounds Error