Added attempts and periodic task