ended event properly implemented