fix tuple index errors
fix tuple index errors