fixed argument indexing issue