Array access bug fixed