replacing NSRunAlertPanel to NSBeginAlertSheet