fixed a typo and an index error on the args