handle alert and graph