Added self.MAX_ATTEMPTS variable