fixed undefined index issue with list