Added tracking for number of attempts