Bug fix

Revised code to consider only first attempts.