update monitor script with retry decorator