Fix add alert and check alert bugs