fixed index error handling in determine_interaction