Using events to detect download finished