implementat close event button