he was still trying to figure out what to do , and where ian had gotten to , when a hand reached through one of the rocks , grabbed his arm , and jerked him sideways just before the pirates rounded the corner .