fixed pin index error