Updated code to only update the duck display at most once per frame